$('.loginAct').on('click', function () {

    var userName = $('#userName').val();
    var password = $('#password').val();
    if (!userName || !password) {
        layer.msg('用户名和密码不可为空哟！！！',
            {icon: 5, height: 'auto', maxHeight: 70, anim: 6, offset: '30px'});
    }
    $.ajax({
        url:'login/action',
        type:'post',
        data:{
            loginName:userName,
            pwd:password,
        },
        isHook:true,
        success:function (res) {
            if(res.state){
                location.href= baseUrl +'index/page';
            }
        }
    })

})